home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
thinkref
/
archive
/
THINKPascalUH2.1.sea
/
THINKPas Univ Hdr 2.1
/
Interfaces
/
FileTransfers.p
< prev
next >
Wrap
Text File
|
1995-09-14
|
11KB
|
311 lines
{ Converted with MPW2TPas Tuesday, September 12, 1995 6:09:33 PM }
{}
{ File: FileTransfers.p}
{ }
{ Contains: CommToolbox File Transfer Manager Interfaces.}
{ }
{ Version: Technology: System 7.5}
{ Package: Universal Interfaces 2.1 in “MPW Latest” on ETO #18}
{ }
{ Copyright: © 1984-1995 by Apple Computer, Inc.}
{ All rights reserved.}
{ }
{ Bugs?: If you find a problem with this file, use the Apple Bug Reporter}
{ stack. Include the file and version information (from above)}
{ in the problem description and send to:}
{ Internet: apple.bugs@applelink.apple.com}
{ AppleLink: APPLE.BUGS}
{ }
{}
unit FileTransfers;
interface
{$IFC UNDEFINED __FILETRANSFERS__}
{$SETC __FILETRANSFERS__ := 1}
uses
ConditionalMacros, Types, Quickdraw, Controls, Windows, Dialogs, AppleTalk, CTBUtilities, Connections, Files, Terminals;
{ $PUSH}
{ $ALIGN MAC68K}
{ $LibExport+}
const
{ current file transfer manager version }
curFTVersion = 2;
{ FTErr }
ftGenericError = -1;
ftNoErr = 0;
ftRejected = 1;
ftFailed = 2;
ftTimeOut = 3;
ftTooManyRetry = 4;
ftNotEnoughDSpace = 5;
ftRemoteCancel = 6;
ftWrongFormat = 7;
ftNoTools = 8;
ftUserCancel = 9;
ftNotSupported = 10;
type
FTErr = OSErr;
const
ftIsFTMode = $1;
ftNoMenus = $2;
ftQuiet = $4;
ftConfigChanged = $10;
ftSucc = $80;
type
FTFlags = LONGINT;
const
ftSameCircuit = $1;
ftSendDisable = $2;
ftReceiveDisable = $4;
ftTextOnly = $8;
ftNoStdFile = $10;
ftMultipleFileSend = $20;
type
FTAttributes = INTEGER;
const
ftReceiving = 0;
ftTransmitting = 1;
type
FTDirection = INTEGER;
{ application routines type definitions }
FTPtr = ^FTRecord;
FTHandle = ^FTPtr;
FileTransferDefProcPtr = ProcPtr; { FUNCTION FileTransferDef(hTerm: TermHandle; msg: INTEGER; p1: LONGINT; p2: LONGINT; p3: LONGINT): LONGINT; }
FileTransferReadProcPtr = ProcPtr; { FUNCTION FileTransferRead(VAR count: LONGINT; pData: Ptr; refCon: LONGINT; fileMsg: INTEGER): OSErr; }
FileTransferWriteProcPtr = ProcPtr; { FUNCTION FileTransferWrite(VAR count: LONGINT; pData: Ptr; refCon: LONGINT; fileMsg: INTEGER): OSErr; }
FileTransferSendProcPtr = ProcPtr; { FUNCTION FileTransferSend(thePtr: Ptr; theSize: LONGINT; refCon: LONGINT; channel: CMChannel; flag: CMFlags): Size; }
FileTransferReceiveProcPtr = ProcPtr; { FUNCTION FileTransferReceive(thePtr: Ptr; theSize: LONGINT; refCon: LONGINT; channel: CMChannel; VAR flag: CMFlags): Size; }
FileTransferEnvironsProcPtr = ProcPtr; { FUNCTION FileTransferEnvirons(refCon: LONGINT; VAR theEnvirons: ConnEnvironRec): OSErr; }
FileTransferNotificationProcPtr = ProcPtr; { PROCEDURE FileTransferNotification(hFT: FTHandle; pFSSpec: FSSpecPtr); }
FileTransferChooseIdleProcPtr = ProcPtr; { PROCEDURE FileTransferChooseIdle; }
FileTransferDefUPP = UniversalProcPtr;
FileTransferReadUPP = UniversalProcPtr;
FileTransferWriteUPP = UniversalProcPtr;
FileTransferSendUPP = UniversalProcPtr;
FileTransferReceiveUPP = UniversalProcPtr;
FileTransferEnvironsUPP = UniversalProcPtr;
FileTransferNotificationUPP = UniversalProcPtr;
FileTransferChooseIdleUPP = UniversalProcPtr;
FTRecord = packed record
procID: INTEGER;
flags: FTFlags;
errCode: FTErr;
refCon: LONGINT;
userData: LONGINT;
defProc: FileTransferDefUPP;
config: Ptr;
oldConfig: Ptr;
environsProc: FileTransferEnvironsUPP;
reserved1: LONGINT;
reserved2: LONGINT;
ftPrivate: Ptr;
sendProc: FileTransferSendUPP;
recvProc: FileTransferReceiveUPP;
writeProc: FileTransferWriteUPP;
readProc: FileTransferReadUPP;
owner: WindowPtr;
direction: FTDirection;
theReply: SFReply;
writePtr: LONGINT;
readPtr: LONGINT;
theBuf: ^CHAR;
bufSize: LONGINT;
autoRec: Str255;
attributes: FTAttributes;
end;
const
{ FTReadProc messages }
ftReadOpenFile = 0; { count = forkFlags, buffer = pblock from PBGetFInfo }
ftReadDataFork = 1;
ftReadRsrcFork = 2;
ftReadAbort = 3;
ftReadComplete = 4;
ftReadSetFPos = 6; { count = forkFlags, buffer = pBlock same as PBSetFPos }
ftReadGetFPos = 7; { count = forkFlags, buffer = pBlock same as PBGetFPos }
{ FTWriteProc messages }
ftWriteOpenFile = 0; { count = forkFlags, buffer = pblock from PBGetFInfo }
ftWriteDataFork = 1;
ftWriteRsrcFork = 2;
ftWriteAbort = 3;
ftWriteComplete = 4;
ftWriteFileInfo = 5;
ftWriteSetFPos = 6; { count = forkFlags, buffer = pBlock same as PBSetFPos }
ftWriteGetFPos = 7; { count = forkFlags, buffer = pBlock same as PBGetFPos }
{ fork flags }
ftOpenDataFork = 1;
ftOpenRsrcFork = 2;
uppFileTransferDefProcInfo = $0000FEF0; { FUNCTION (4 byte param, 2 byte param, 4 byte param, 4 byte param, 4 byte param): 4 byte result; }
uppFileTransferReadProcInfo = $00002FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 2 byte param): 2 byte result; }
uppFileTransferWriteProcInfo = $00002FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 2 byte param): 2 byte result; }
uppFileTransferSendProcInfo = $0000AFF0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 2 byte param, 2 byte param): 4 byte result; }
uppFileTransferReceiveProcInfo = $0000EFF0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 2 byte param, 4 byte param): 4 byte result; }
uppFileTransferEnvironsProcInfo = $000003E0; { FUNCTION (4 byte param, 4 byte param): 2 byte result; }
uppFileTransferNotificationProcInfo = $000003C0; { PROCEDURE (4 byte param, 4 byte param); }
uppFileTransferChooseIdleProcInfo = $00000000; { PROCEDURE ; }
function NewFileTransferDefProc (userRoutine: FileTransferDefProcPtr): FileTransferDefUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewFileTransferReadProc (userRoutine: FileTransferReadProcPtr): FileTransferReadUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewFileTransferWriteProc (userRoutine: FileTransferWriteProcPtr): FileTransferWriteUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewFileTransferSendProc (userRoutine: FileTransferSendProcPtr): FileTransferSendUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewFileTransferReceiveProc (userRoutine: FileTransferReceiveProcPtr): FileTransferReceiveUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewFileTransferEnvironsProc (userRoutine: FileTransferEnvironsProcPtr): FileTransferEnvironsUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewFileTransferNotificationProc (userRoutine: FileTransferNotificationProcPtr): FileTransferNotificationUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function NewFileTransferChooseIdleProc (userRoutine: FileTransferChooseIdleProcPtr): FileTransferChooseIdleUPP;
{$IFC NOT GENERATINGCFM }
inline
$2E9F;
{$ENDC}
function CallFileTransferDefProc (hTerm: TermHandle; msg: INTEGER; p1: LONGINT; p2: LONGINT; p3: LONGINT; userRoutine: FileTransferDefUPP): LONGINT;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallFileTransferReadProc (var count: LONGINT; pData: Ptr; refCon: LONGINT; fileMsg: INTEGER; userRoutine: FileTransferReadUPP): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallFileTransferWriteProc (var count: LONGINT; pData: Ptr; refCon: LONGINT; fileMsg: INTEGER; userRoutine: FileTransferWriteUPP): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallFileTransferSendProc (thePtr: Ptr; theSize: LONGINT; refCon: LONGINT; channel: CMChannel; flag: CMFlags; userRoutine: FileTransferSendUPP): Size;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallFileTransferReceiveProc (thePtr: Ptr; theSize: LONGINT; refCon: LONGINT; channel: CMChannel; var flag: CMFlags; userRoutine: FileTransferReceiveUPP): Size;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function CallFileTransferEnvironsProc (refCon: LONGINT; var theEnvirons: ConnEnvironRec; userRoutine: FileTransferEnvironsUPP): OSErr;
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
procedure CallFileTransferNotificationProc (hFT: FTHandle; pFSSpec: FSSpecPtr; userRoutine: FileTransferNotificationUPP);
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
procedure CallFileTransferChooseIdleProc (userRoutine: FileTransferChooseIdleUPP);
{$IFC NOT GENERATINGCFM}
inline
$205F, $4E90;
{$ENDC}
function InitFT: FTErr;
function FTGetVersion (hFT: FTHandle): Handle;
function FTGetFTVersion: INTEGER;
function FTNew (procID: INTEGER; flags: FTFlags; sendProc: FileTransferSendUPP; recvProc: FileTransferReceiveUPP; readProc: FileTransferReadUPP; writeProc: FileTransferWriteUPP; environsProc: FileTransferEnvironsUPP; owner: WindowPtr; refCon: LONGINT; userData: LONGINT): FTHandle;
procedure FTDispose (hFT: FTHandle);
function FTStart (hFT: FTHandle; direction: FTDirection; {CONST}
var fileInfo: SFReply): FTErr;
function FTAbort (hFT: FTHandle): FTErr;
function FTSend (hFT: FTHandle; numFiles: INTEGER; pFSSpec: FSSpecArrayPtr; notifyProc: FileTransferNotificationUPP): FTErr;
function FTReceive (hFT: FTHandle; pFSSpec: FSSpecPtr; notifyProc: FileTransferNotificationUPP): FTErr;
procedure FTExec (hFT: FTHandle);
procedure FTActivate (hFT: FTHandle; activate: BOOLEAN);
procedure FTResume (hFT: FTHandle; resume: BOOLEAN);
function FTMenu (hFT: FTHandle; menuID: INTEGER; item: INTEGER): BOOLEAN;
function FTChoose (var hFT: FTHandle; where: Point; idleProc: FileTransferChooseIdleUPP): INTEGER;
procedure FTEvent (hFT: FTHandle; {CONST}
var theEvent: EventRecord);
function FTValidate (hFT: FTHandle): BOOLEAN;
procedure FTDefault (var theConfig: Ptr; procID: INTEGER; allocate: BOOLEAN);
function FTSetupPreflight (procID: INTEGER; var magicCookie: LONGINT): Handle;
procedure FTSetupSetup (procID: INTEGER; theConfig: univ Ptr; count: INTEGER; theDialog: DialogPtr; var magicCookie: LONGINT);
function FTSetupFilter (procID: INTEGER; theConfig: univ Ptr; count: INTEGER; theDialog: DialogPtr; var theEvent: EventRecord; var theItem: INTEGER; var magicCookie: LONGINT): BOOLEAN;
procedure FTSetupItem (procID: INTEGER; theConfig: univ Ptr; count: INTEGER; theDialog: DialogPtr; var theItem: INTEGER; var magicCookie: LONGINT);
procedure FTSetupXCleanup (procID: INTEGER; theConfig: univ Ptr; count: INTEGER; theDialog: DialogPtr; OKed: BOOLEAN; var magicCookie: LONGINT);
procedure FTSetupPostflight (procID: INTEGER);
function FTGetConfig (hFT: FTHandle): Ptr;
function FTSetConfig (hFT: FTHandle; thePtr: univ Ptr): INTEGER;
function FTIntlToEnglish (hFT: FTHandle; inputPtr: univ Ptr; var outputPtr: Ptr; language: INTEGER): OSErr;
function FTEnglishToIntl (hFT: FTHandle; inputPtr: univ Ptr; var outputPtr: Ptr; language: INTEGER): OSErr;
procedure FTGetToolName (procID: INTEGER; var name: Str255);
function FTGetProcID (name: ConstStr255Param): INTEGER;
procedure FTSetRefCon (hFT: FTHandle; refCon: LONGINT);
function FTGetRefCon (hFT: FTHandle): LONGINT;
procedure FTSetUserData (hFT: FTHandle; userData: LONGINT);
function FTGetUserData (hFT: FTHandle): LONGINT;
procedure FTGetErrorString (hFT: FTHandle; id: INTEGER; var errMsg: Str255);
{ $ALIGN RESET}
{ $POP}
{$ENDC}
{__FILETRANSFERS__}
implementation
end.